﻿<%@ Page Language="C#" MasterPageFile="~/Theme/Default/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <!--内容部分-->
    <div id="container">

        <script type="text/javascript"><!--

            function getURLVar(urlVarName) {

                var urlHalves = String(document.location).toLowerCase().split('?');

                var urlVarValue = '';



                if (urlHalves[1]) {

                    var urlVars = urlHalves[1].split('&');



                    for (var i = 0; i <= (urlVars.length); i++) {

                        if (urlVars[i]) {

                            var urlVarPair = urlVars[i].split('=');



                            if (urlVarPair[0] && urlVarPair[0] == urlVarName.toLowerCase()) {

                                urlVarValue = urlVarPair[1];

                            }

                        }

                    }

                }



                return urlVarValue;

            }



            $(document).ready(function() {

                route = getURLVar('route');



                if (!route) {

                    $('#tab_home').addClass('selected');

                } else {

                    part = route.split('/');



                    if (route == 'common/home') {

                        $('#tab_home').addClass('selected');

                    } else if (route == 'account/login') {

                        $('#tab_login').addClass('selected');

                    } else if (part[0] == 'account') {

                        $('#tab_account').addClass('selected');

                    } else if (route == 'checkout/cart') {

                        $('#tab_cart').addClass('selected');

                    } else if (part[0] == 'checkout') {

                        $('#tab_checkout').addClass('selected');

                    } else {

                        $('#tab_home').addClass('selected');

                    }

                }

            });

//--></script>

        <script type="text/javascript"><!--

            $('#search input').keydown(function(e) {

                if (e.keyCode == 13) {

                    moduleSearch();

                }

            });



            function moduleSearch() {

                url = 'index.php?route=product/search';



                var filter_keyword = $('#filter_keyword').attr('value')



                if (filter_keyword) {

                    url += '&keyword=' + encodeURIComponent(filter_keyword);

                }



                var filter_category_id = $('#filter_category_id').attr('value');



                if (filter_category_id) {

                    url += '&category_id=' + filter_category_id;

                }



                location = url;

            }

//--></script>

        <script type="text/javascript"><!--

            $('.switcher').bind('click', function() {

                $(this).find('.option').slideToggle('fast');

            });

            $('.switcher').bind('mouseleave', function() {

                $(this).find('.option').slideUp('fast');

            }); 

//--></script>

        <!--左侧-->
        <div id="column_left">
            <div class="box">
                <div class="top">
                    <img src="<%= ViewData["ThemePath"] %>/content/image/category.png" alt="" />Categories</div>
                <!--分类导航-->
                <% Html.RenderAction("All", "Category"); %>                
                <div class="bottom">
                    &nbsp;</div>
            </div>
            <div class="box">
                <div class="top">
                    <img src="<%= ViewData["ThemePath"] %>/content/image/brands.png" alt="" />Brands</div>
                <div class="middle" style="text-align: center;">
                    <select onchange="location = this.value">
                        <option value="">--- Please Select --- </option>
                        <option value="http://localhost:8080/opencart/index.php?route=product/manufacturer&amp;manufacturer_id=8">
                            Apple</option>
                        <option value="http://localhost:8080/opencart/index.php?route=product/manufacturer&amp;manufacturer_id=9">
                            Canon</option>
                        <option value="http://localhost:8080/opencart/index.php?route=product/manufacturer&amp;manufacturer_id=7">
                            Hewlett-Packard</option>
                        <option value="http://localhost:8080/opencart/index.php?route=product/manufacturer&amp;manufacturer_id=5">
                            HTC</option>
                        <option value="http://localhost:8080/opencart/index.php?route=product/manufacturer&amp;manufacturer_id=6">
                            Palm</option>
                        <option value="http://localhost:8080/opencart/index.php?route=product/manufacturer&amp;manufacturer_id=10">
                            Sony</option>
                    </select>
                </div>
                <div class="bottom">
                    &nbsp;</div>
            </div>
            <div class="box">
                <div class="top">
                    <img src="<%= ViewData["ThemePath"] %>/content/image/information.png" alt="" />Information</div>
                <div id="information" class="middle">
                    <ul>
                        <li><a href="http://localhost:8080/opencart/index.php?route=information/information&amp;information_id=4">
                            About Us</a></li>
                        <li><a href="http://localhost:8080/opencart/index.php?route=information/information&amp;information_id=3">
                            Privacy Policy</a></li>
                        <li><a href="http://localhost:8080/opencart/index.php?route=information/information&amp;information_id=5">
                            Terms &amp; Conditions</a></li>
                        <li><a href="http://localhost:8080/opencart/index.php?route=information/contact">Contact
                            Us</a></li>
                        <li><a href="http://localhost:8080/opencart/index.php?route=information/sitemap">Site
                            Map</a></li>
                    </ul>
                </div>
                <div class="bottom">
                    &nbsp;</div>
            </div>
        </div>
        <!--右侧-->
        <div id="column_right">
            <div id="module_cart" class="box">
                <div class="top">
                    <img src="<%= ViewData["ThemePath"] %>/content/image/basket.png" alt="" />Shopping
                    Cart</div>
                <div class="middle">
                    <div style="text-align: center;">
                        0 items</div>
                </div>
                <div class="bottom">
                    &nbsp;</div>
            </div>

            <script type="text/javascript" src="catalog/view/javascript/jquery/ajax_add.js"></script>

            <script type="text/javascript"><!--

                function getUrlParam(name) {
                    var name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
                    var regexS = "[\\?&]" + name + "=([^&#]*)";
                    var regex = new RegExp(regexS);
                    var results = regex.exec(window.location.href);
                    if (results == null)
                        return "";
                    else
                        return results[1];
                }

                $(document).ready(function() {
                    $('.cart_remove').live('click', function() {
                        if (!confirm('Confirm?')) {
                            return false;
                        }
                        $(this).removeClass('cart_remove').addClass('cart_remove_loading');
                        $.ajax({
                            type: 'post',
                            url: 'index.php?route=module/cart/callback',
                            dataType: 'html',
                            data: 'remove=' + this.id,
                            success: function(html) {
                                $('#module_cart .middle').html(html);
                                if (getUrlParam('route').indexOf('checkout') != -1) {
                                    window.location.reload();
                                }
                            }
                        });
                    });
                });
//--></script>

            <div class="box">
                <div class="top">
                    <img src="<%= ViewData["ThemePath"] %>/content/image/bestsellers.png" alt="" />Bestsellers</div>
                <div class="middle">
                </div>
                <div class="bottom">
                    &nbsp;</div>
            </div>
            <div class="box">
                <div class="top">
                    <img src="<%= ViewData["ThemePath"] %>/content/image/featured.png" alt="" />Featured</div>
                <div class="middle">
                    <table cellpadding="2" cellspacing="0" style="width: 100%;">
                        <tr>
                            <td valign="top" style="width: 1px">
                                <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=42">
                                    <img src="http://localhost:8080/opencart/image/cache/data/apple_cinema_30-38x38.jpg"
                                        alt="Apple Cinema 30&quot;" /></a>
                            </td>
                            <td valign="top">
                                <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=42">
                                    Apple Cinema 30&quot;</a>
                                <br />
                                <span style="font-size: 11px; color: #900;">￡100.00</span> <a class="button_add_small"
                                    href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=42"
                                    title="Add to Cart">&nbsp;</a>
                                <br />
                                <img src="<%= ViewData["ThemePath"] %>/content/image/stars_2.png" alt="2 out of 5 Stars!" />
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" style="width: 1px">
                                <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=28">
                                    <img src="http://localhost:8080/opencart/image/cache/data/htc_touch_hd_1-38x38.jpg"
                                        alt="HTC Touch HD" /></a>
                            </td>
                            <td valign="top">
                                <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=28">
                                    HTC Touch HD</a>
                                <br />
                                <span style="font-size: 11px; color: #900;">￡569.22</span> <a class="button_add_small"
                                    href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=28"
                                    title="Add to Cart">&nbsp;</a>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" style="width: 1px">
                                <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=43">
                                    <img src="http://localhost:8080/opencart/image/cache/data/macbook_1-38x38.jpg" alt="MacBook" /></a>
                            </td>
                            <td valign="top">
                                <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=43">
                                    MacBook</a>
                                <br />
                                <span style="font-size: 11px; color: #900;">￡587.50</span> <a class="button_add_small"
                                    href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=43"
                                    title="Add to Cart">&nbsp;</a>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" style="width: 1px">
                                <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=44">
                                    <img src="http://localhost:8080/opencart/image/cache/data/macbook_air_1-38x38.jpg"
                                        alt="MacBook Air" /></a>
                            </td>
                            <td valign="top">
                                <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=44">
                                    MacBook Air</a>
                                <br />
                                <span style="font-size: 11px; color: #900;">￡1,175.00</span> <a class="button_add_small"
                                    href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=44"
                                    title="Add to Cart">&nbsp;</a>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" style="width: 1px">
                                <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=45">
                                    <img src="http://localhost:8080/opencart/image/cache/data/macbook_pro_1-38x38.jpg"
                                        alt="MacBook Pro" /></a>
                            </td>
                            <td valign="top">
                                <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=45">
                                    MacBook Pro</a>
                                <br />
                                <span style="font-size: 11px; color: #900;">￡2,350.00</span> <a class="button_add_small"
                                    href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=45"
                                    title="Add to Cart">&nbsp;</a>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="bottom">
                    &nbsp;</div>
            </div>
        </div>
        <!--中间-->
        <div id="content">
            <div class="top">
                <div class="left">
                </div>
                <div class="right">
                </div>
                <div class="center">
                    <h1>
                        Welcome to Your Store</h1>
                </div>
            </div>
            <div class="middle">
                <div>
                    <p>
                        Welcome to my store!</p>
                </div>
            </div>
            <div class="bottom">
                <div class="left">
                </div>
                <div class="right">
                </div>
                <div class="center">
                </div>
            </div>
            <div class="top">
                <div class="left">
                </div>
                <div class="right">
                </div>
                <div class="center">
                    <div class="heading">
                        Latest Products</div>
                </div>
            </div>
            <div class="middle">
                <table class="list">
                    <tr>
                        <td style="width: 25%;">
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=48">
                                <img src="http://localhost:8080/opencart/image/cache/data/ipod_classic_1-120x120.jpg"
                                    title="iPod Classic" alt="iPod Classic" /></a><br />
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=48">
                                iPod Classic</a><br />
                            <span style="color: #999; font-size: 11px;">product 20</span><br />
                            <span style="color: #900; font-weight: bold;">￡117.50</span> <a class="button_add_small"
                                href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=48"
                                title="Add to Cart">&nbsp;</a>
                            <br />
                        </td>
                        <td style="width: 25%;">
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=47">
                                <img src="http://localhost:8080/opencart/image/cache/data/hp_1-120x120.jpg" title="HP LP3065"
                                    alt="HP LP3065" /></a><br />
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=47">
                                HP LP3065</a><br />
                            <span style="color: #999; font-size: 11px;">Product 21</span><br />
                            <span style="color: #900; font-weight: bold;">￡1,175.00</span> <a class="button_add_small"
                                href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=47"
                                title="Add to Cart">&nbsp;</a>
                            <br />
                            <img src="<%= ViewData["ThemePath"] %>/content/image/stars_3.png" alt="3 out of 5 Stars!" />
                        </td>
                        <td style="width: 25%;">
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=46">
                                <img src="http://localhost:8080/opencart/image/cache/data/sony_vaio_1-120x120.jpg"
                                    title="Sony VAIO" alt="Sony VAIO" /></a><br />
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=46">
                                Sony VAIO</a><br />
                            <span style="color: #999; font-size: 11px;">Product 19</span><br />
                            <span style="color: #900; font-weight: bold;">￡1,175.00</span> <a class="button_add_small"
                                href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=46"
                                title="Add to Cart">&nbsp;</a>
                            <br />
                        </td>
                        <td style="width: 25%;">
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=45">
                                <img src="http://localhost:8080/opencart/image/cache/data/macbook_pro_1-120x120.jpg"
                                    title="MacBook Pro" alt="MacBook Pro" /></a><br />
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=45">
                                MacBook Pro</a><br />
                            <span style="color: #999; font-size: 11px;">Product 18</span><br />
                            <span style="color: #900; font-weight: bold;">￡2,350.00</span> <a class="button_add_small"
                                href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=45"
                                title="Add to Cart">&nbsp;</a>
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 25%;">
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=44">
                                <img src="http://localhost:8080/opencart/image/cache/data/macbook_air_1-120x120.jpg"
                                    title="MacBook Air" alt="MacBook Air" /></a><br />
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=44">
                                MacBook Air</a><br />
                            <span style="color: #999; font-size: 11px;">Product 17</span><br />
                            <span style="color: #900; font-weight: bold;">￡1,175.00</span> <a class="button_add_small"
                                href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=44"
                                title="Add to Cart">&nbsp;</a>
                            <br />
                        </td>
                        <td style="width: 25%;">
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=43">
                                <img src="http://localhost:8080/opencart/image/cache/data/macbook_1-120x120.jpg"
                                    title="MacBook" alt="MacBook" /></a><br />
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=43">
                                MacBook</a><br />
                            <span style="color: #999; font-size: 11px;">Product 16</span><br />
                            <span style="color: #900; font-weight: bold;">￡587.50</span> <a class="button_add_small"
                                href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=43"
                                title="Add to Cart">&nbsp;</a>
                            <br />
                        </td>
                        <td style="width: 25%;">
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=42">
                                <img src="http://localhost:8080/opencart/image/cache/data/apple_cinema_30-120x120.jpg"
                                    title="Apple Cinema 30&quot;" alt="Apple Cinema 30&quot;" /></a><br />
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=42">
                                Apple Cinema 30&quot;</a><br />
                            <span style="color: #999; font-size: 11px;">Product 15</span><br />
                            <span style="color: #900; font-weight: bold;">￡100.00</span> <a class="button_add_small"
                                href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=42"
                                title="Add to Cart">&nbsp;</a>
                            <br />
                            <img src="<%= ViewData["ThemePath"] %>/content/image/stars_2.png" alt="2 out of 5 Stars!" />
                        </td>
                        <td style="width: 25%;">
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=41">
                                <img src="http://localhost:8080/opencart/image/cache/data/imac_1-120x120.jpg" title="iMac"
                                    alt="iMac" /></a><br />
                            <a href="http://localhost:8080/opencart/index.php?route=product/product&amp;product_id=41">
                                iMac</a><br />
                            <span style="color: #999; font-size: 11px;">Product 14</span><br />
                            <span style="color: #900; font-weight: bold;">￡587.50</span> <a class="button_add_small"
                                href="http://localhost:8080/opencart/index.php?route=checkout/cart&amp;product_id=41"
                                title="Add to Cart">&nbsp;</a>
                            <br />
                        </td>
                    </tr>
                </table>
            </div>
            <div class="bottom">
                <div class="left">
                </div>
                <div class="right">
                </div>
                <div class="center">
                </div>
            </div>
        </div>
    </div>
</asp:Content>
